import xadmin
from xadmin import views


class BaseSetting(object):
    """xadmin的基本配置"""
    # enable_themes = True  # 开启主题切换功能
    use_bootswatch = True


xadmin.site.register(views.BaseAdminView, BaseSetting)


class GlobalSettings(object):
    """xadmin的全局配置"""
    site_title = '路飞学诚'   # 设置站点标题
    site_footer = '路飞学诚有限公司'  # 设置站点的页脚
    menu_style = 'accordion'   # 设置菜单折叠


xadmin.site.register(views.CommAdminView, GlobalSettings)

# 轮播图
from .models import BannerModel, NavModel


class BannerModelAdmin():
    list_display = ['id', 'name', 'orders', 'is_show']
    search_fields = ['name']  # 自定义搜索功能


xadmin.site.register(BannerModel, BannerModelAdmin)


class NavModelAdmin():
    list_display = ['id', 'name', 'link', 'opt', 'create_time']
    search_fields = ['name']


xadmin.site.register(NavModel, NavModelAdmin)





